<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{:config('PRODUCT_NAME')} | {block name="title"}{$title}{/block}</title>
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" href="__PLUGIN__/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="//cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">
    <link rel="stylesheet" href="__CSS__/AdminLTE.min.css">
    <link rel="stylesheet" href="__CSS__/skins/_all-skins.min.css">
    <link rel="icon" href="__IMG__/favicon.ico">
    <style>
        body{
            font-family: "Microsoft YaHei",FontAwesome,sans-serif;
        }
        .builder-data-empty {
            margin-bottom: 20px;
            background-color: #f9f9f9;
        }
        .no-data {
            padding: 130px 0;
            color: #555;
        }
        .am-text-center {
            text-align: center !important;
        }
        a{
            cursor:pointer;
        }
    </style>
    {block name="myStyle"}{/block}
    <!--[if lt IE 9]>
    <script src="__PLUGIN__/compatible/html5shiv.js"></script>
    <script src="__PLUGIN__/compatible/respond.min.js"></script>
    <![endif]-->
</head>
<body class="hold-transition skin-blue sidebar-mini fixed">
    <div class="wrapper">
        <!--顶部banner-->
        <header class="main-header">
            <a href="{:url('Index/index')}" class="logo" style="height: 52px">
                <span class="logo-mini">
                    <img src="__IMG__/logo.jpg" width="51px" alt="">
                </span>
                <span class="logo-lg">ApiAdmin</span>
            </a>
            <nav class="navbar navbar-static-top">
                <a href="javascript:void(0);" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                    <span class="sr-only">Toggle navigation</span>
                </a>
                <div class="navbar-custom-menu">
                    <ul class="nav navbar-nav">
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <img src="__IMG__/logo.jpg" class="user-image" alt="User Image">
                                <span class="hidden-xs">{$userInfo['username']}</span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header">
                                    <img src="__IMG__/logo.jpg" class="img-circle" alt="User Image">

                                    <p>
                                        {$userInfo['username']} - {$userInfo['nickname']}
                                        <small>注册时间：{$userInfo['regTime'] | date='Y-m-d',###}</small>
                                    </p>
                                </li>
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
                                        <a url="{:url('User/edit')}" class="refresh btn btn-default btn-flat">修改信息</a>
                                    </div>
                                    <div class="pull-right">
                                        <a href="{:url('User/logout')}" class="btn btn-default btn-flat">退出登录</a>
                                    </div>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
            </nav>
        </header>
        <!-- 左侧导航栏 -->
        <aside class="main-sidebar" id="main-sidebar">
            <section class="sidebar">
                <!--管理员信息-->
                <div class="user-panel">
                    <div class="pull-left image">
                        <img src="__IMG__/logo.jpg" class="img-circle" alt="头像">
                    </div>
                    <div class="pull-left info">
                        <p>{$userInfo['nickname']}</p>
                        <a href="javascript:void(0);"><i class="fa fa-circle text-success"></i> Online</a>
                    </div>
                </div>
                <!--搜索表单-->
                <form action="#" method="get" class="sidebar-form">
                    <div class="input-group">
                        <input type="text" name="q" class="form-control" placeholder="Search...">
                        <span class="input-group-btn">
                            <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i></button>
                        </span>
                    </div>
                </form>
                <ul class="sidebar-menu">
                    <li class="header">主菜单</li>
                    {volist name="menuData" id="menuValue"}
                        {if condition="!empty($menuValue['url']) OR (isset($menuValue['_child']) AND count($menuValue['_child']))"}
                            {if condition="isset($menuValue['_child']) AND count($menuValue['_child'])"}
                                <li class="treeview">
                                    <a href="javascript:void(0);">
                                        <i class="fa {$menuValue['icon']}"></i> <span class="menuFather">{$menuValue['name']}</span>
                                        <span class="pull-right-container">
                                            <i class="fa fa-angle-left pull-right"></i>
                                        </span>
                                    </a>
                                    <ul class="treeview-menu">
                                        {volist name="menuValue['_child']" id="childValue"}
                                            <li class="menuChild"><a url="{:url($childValue['url'])}" class="refresh"><i class="fa {$childValue['icon']}"></i> {$childValue['name']}</a></li>
                                        {/volist}
                                    </ul>
                                </li>
                            {else /}
                                <li>
                                    <a url="{:url($menuValue['url'])}" class="refresh">
                                        <i class="fa {$menuValue['icon']}"></i> <span class="menuFather">{$menuValue['name']}</span>
                                    </a>
                                </li>
                            {/if}
                        {/if}
                    {/volist}
                </ul>
            </section>
        </aside>

        <div class="content-wrapper">
            <!-- 头部（面包屑导航） -->
            <section class="content-header" id="content-header">
                <h1>{$title}</h1>
                <ol class="breadcrumb" id="breadcrumb">
                    <li><i class="fa fa-dashboard"></i>　首页</li>
                </ol>
            </section>
            <section class="content" id="content">
                {block name="content"}{/block}
            </section>
        </div>

        <!-- 公用底部(完成适配) -->
        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version</b> {:config('PRODUCT_VERSION')}
            </div>
            <strong>Copyright &copy; 2014-{:date('Y')} <a href="{:config('WEBSITE_DOMAIN')}">{:config('COMPANY_NAME')}</a>.</strong> All rights reserved.
        </footer>
        <!-- 主题适配相关(完成适配) -->
        <div class="control-sidebar-bg"></div>
    </div>
    <!-- jQuery 2.2.3 -->
    <script src="__PLUGIN__/jQuery/2.2.4/jquery.min.js"></script>
    <!-- Bootstrap 3.3.6 -->
    <script src="__PLUGIN__/bootstrap/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="__PLUGIN__/fastClick/fastclick.js"></script>
    <!-- slimScroll -->
    <script src="__PLUGIN__/slimScroll/jquery.slimscroll.min.js"></script>
    <!-- BootBox -->
    <script src="__PLUGIN__/bootBox/bootbox.min.js"></script>
    <!-- AdminLTE App -->
    <script src="__JS__/app.min.js"></script>
    <!-- AdminLTE for demo purposes -->
    <script src="__JS__/demo.js"></script>
    <script>
        var JS_PATH = '__JS__';
        var CSS_PATH = '__CSS__';
        var STATIC_PATH = '__STATIC__';
        var IMG_PATH = '__IMG__';
        var PLUGIN_PATH = '__PLUGIN__';
        var COMPANY_NAME = '{:config("COMPANY_NAME")}';

        /**
         * 自动适配面包屑导航
         */
        $('body').on('click', '.menuChild', function() {
            $('.menuChild').removeClass('active');
            $(this).addClass('active');
            var parentName = $.trim($(this).parent().prev().text());
            var ownName = $(this).children('a').text();
            var breadcrumb = $('#breadcrumb');
            breadcrumb.html('<li><i class="fa fa-dashboard"></i>　首页</li>');
            breadcrumb.append('<li>'+ parentName +'</li><li>'+ ownName +'</li>');
            breadcrumb.prev().text(ownName);
        });
    </script>
    <script src="__JS__/template.js"></script>
    {block name="myScript"}{/block}
</body>
</html>
